var app = getApp();
var Util = require('../../utils/util.js')
var Json= require('../../json.js')
Page({
  /**
   * 页面的初始数据
   */
 
  data: {
   parameter:{
      'title': '餐厅列表',
      'navbar': '1'
    },
    selectedLocation:{
      name:"全部"
    },
    selectedState:{
      name:"状态"
    },
    locations: [{
      name:"省委集中办公区"
    }, {
        name: "集中办公区一"
      }, {
        name: "集中办公区二"
      }],
    states:[{
      name:"空闲"
    },{
      name:"爆满"
    }],
    openLocationSelect:false,
    openStateSelect: false,
    restaurant:[]
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },
  openLocationSelect:function(){
      this.setData({
        openLocationSelect: !this.data.openLocationSelect
      })
  },
  openStateSelect:function(){
    this.setData({
      openStateSelect: !this.data.openStateSelect
    })
  },
  selectLocation:function(e){
    var id = e.currentTarget.dataset['id'];
    this.setData({
      openLocationSelect: false
    })
  },
  selectState:function(e){
    var id =  e.currentTarget.dataset['id'];
    this.setData({
      openStateSelect: false
    })
  },
 
  catchTouchMove: function (res) {
    return false
  },
  onColse:function(){

  },
 
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

    var that = this
  
    //模拟数据
    that.setData({
      user: Json.default.userIn,
      restaurant: Json.default.restaurant
    })
  }, formSubmit: function (e) {
    app.Tips({ title: '提交成功', icon: 'success' },'/pages/repair-receive/index');
  }
})